/*
Copyright (C) 2008, 2009 Henrik Naess

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/

using System;
using System.Drawing;
using System.Globalization;
using ZoneFiveSoftware.Common.Visuals;
using System.Collections.Generic;

namespace MatrixPlugin.Constants
{
    /// <summary>
    /// Constants that are used for the plugin
    /// </summary>
    public static class General
    {
        public static readonly string Delimiter = ";";
        /// <summary>
        /// Default constructor, that read settings from settings (preferences) file
        /// </summary>
        static General()
        {
            if (CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator == ".")
                Delimiter = ",";
            else
                Delimiter = ";";
        }

        public enum TempoType
        {
            Fastest,
            Median,
            Slowest
        }

        public class TempoTypeLabelProvider : TreeList.ILabelProvider
        {
            public static IList<TempoType> getValues()
            {
                var results = (IList<TempoType>)Enum.GetValues(typeof(TempoType));
                return results;
            }

            public Image GetImage(object element, TreeList.Column column)
            {
                return null;
            }
            public string GetText(object element, TreeList.Column column)
            {
                return GetText((TempoType)element);
            }
            public static string GetText(TempoType t)
            {
                switch (t)
                {
                    case TempoType.Fastest:
                        return Properties.Resources.TempoType_Fastest;
                    case TempoType.Slowest:
                        return Properties.Resources.TempoType_Slowest;
                    case TempoType.Median:
                    default:
                        return Properties.Resources.TempoType_Median;
                }
            }
        }
        /****************************************************************/
        public enum DataValue
        {
            speed,
            pace,
            time,
            elevation,
            distance
        }

        public class DataValueLabelProvider : TreeList.ILabelProvider
        {
            public static IList<DataValue> getValues()
            {
                IList<DataValue> results = (IList<DataValue>)Enum.GetValues(typeof(DataValue));
                return results;
            }

            public Image GetImage(object element, TreeList.Column column)
            {
                return null;
            }
            public string GetText(object element, TreeList.Column column)
            {
                return GetText((DataValue)element);
            }
            public static string GetText(DataValue t)
            {
                switch (t)
                {
                    case DataValue.distance:
                        return Properties.Resources.DataValue_distance;
                    case DataValue.elevation:
                        return Properties.Resources.DataValue_elevation;
                    case DataValue.speed:
                        return Properties.Resources.DataValue_speed;
                    case DataValue.pace:
                        return Properties.Resources.DataValue_pace;
                    case DataValue.time:
                    default:
                        return Properties.Resources.DataValue_time;
                }
            }
        }
    }
}